package com.bleeth.fx.view.demo2;

import com.bleeth.fx.helper.StyleHelper;
import com.bleeth.fx.layout.FormBuilder;
import com.bleeth.fx.layout.GirdCell;
import com.bleeth.fx.meta.IForm;
import com.bleeth.fx.meta.View;
import com.bleeth.fx.meta.ViewRouter;
import javafx.beans.property.Property;
import javafx.geometry.Pos;
import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;

/**
 * @author Sakura
 * @version 1.0
 * @date 2021-11-13 22:17
 **/
@View(value = "main",type = "begin")
public class Demo2MainView implements IForm {

    private VBox mainBox;
    @Override
    public Region make(Property... properties) {

         mainBox = FormBuilder.form(1300D, 800D)
                .addRow(GirdCell.createCell(1, Pos.CENTER))
                .coverCell(0,  ViewRouter.builder().push("top"))
                .endRow(false)
                .scaleRow(0.95,GirdCell.createCell(300D, Pos.CENTER), GirdCell.createCell(20D, Pos.CENTER_LEFT),
                        GirdCell.createCell(1, Pos.CENTER_LEFT), GirdCell.createCell(20D, Pos.CENTER_LEFT))
                .coverCell(0,  ViewRouter.builder().push("left"))
                .coverCell(2,  ViewRouter.builder().push("content"))
                .endRow(false)
                .build();
        css();
        return mainBox;
    }

    @Override
    public void css() {
        StyleHelper.bg(mainBox).color("#f4f4f4").make();

    }


}
